<template>
  <div>
    <hr>
    <h3>-------这是父组件-------- {{ num }}</h3>

    <!-- <son :value="num" @sum="num++" /> -->
    <son :value="num" @input="addnum" />
    <son v-model="num" />
  </div>
</template>

<script>
import son from './son.vue'
export default {
  components: { son },
  data() {
    return {
      num: 18
    }
  },
  methods: {
    addnum(val) {
      this.num = val
    }
  }

}
</script>

<style>

</style>
